package com.zhanghe.study.netty.buf;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.CompositeByteBuf;
import io.netty.buffer.Unpooled;

/**
 * @author zh
 * @date 2022/2/17 11:33
 */
public class TestBuf {
    public static void main(String[] args) {
        // 堆缓冲区
        ByteBuf byteBuf = Unpooled.buffer(8);
        // 堆外缓冲区
        ByteBuf directBuffer = Unpooled.directBuffer(8);
        // 复合缓冲区，一部分是堆缓冲区，一部分是堆外缓冲区
        CompositeByteBuf compositeByteBuf = Unpooled.compositeBuffer();
        compositeByteBuf.addComponents(byteBuf,directBuffer);

    }
}
